home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-15 | 595 b | 40 lines | [TEXT/KAHL] |
- // TimeStamp.c
- //
- // Example device parser
- //
- // PARS resource for S-Tool
- // creates a timestamp for readings by recording the time a value came through
- //
-
- #include <stdio.h>
- #include <string.h>
- #include <SetUpA4.h>
-
- main(char *inString, char *outString) // standard arguments for
- // S-Tool main
- {
- double num;
- DateTimeRec now;
-
- RememberA0();
- SetUpA4();
-
- sscanf(inString, "%lf", &num);
-
- GetTime(&now);
-
- /* output:
-
- hour:minute.second (tab) number
-
- eg:
-
- 15:27.15 3.752
-
- */
-
- sprintf(outString, "%d:%d.%d\t%.3lf\n", now.hour, now.minute, now.second, num);
-
- RestoreA4();
- }
-